package com.paotui.common;

import lombok.Builder;
import lombok.Data;

@Builder
@Data
public class R {
    private static Integer SUCCESS_CODE=200;

    private static Integer FAIL_CODE=500;
    private Integer code;
    private String message;
    private Object data;
    public static R success(String message){
        return R.builder().code(SUCCESS_CODE).message(message).build();
    }
    public static R success(String message,Object data){
        return R.builder().code(SUCCESS_CODE).message(message).data(data).build();
    }
    public static R fail(String message){
        return R.builder().code(FAIL_CODE).message(message).build();
    }
    /*
    public static R success(String message,Object data){
        return R.builder().code(SUCCESS_CODE).message(message).data(data).build();
    }
    */
}
